package com.liu.test.domain;

/**
 * @author LIU
 * @version 1.0
 * @description TODO
 * @date 2023/12/10 22:51
 */
public class Father {
    int x = 10;

    public Father() {
        this.print();
        x = 20;
    }
    public void print(){
        System.out.println("father " + x);
    }

    public static void main(String[] args) {
        Father f = new Son();
        System.out.println(f.x);
    }
}

class Son extends Father{
    int x = 30;
    public Son() {
        this.print();
        x = 40;
    }

    public void print(){
        System.out.println("son " + x);
    }
}
